package round82;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

/**
 * User: Samuel
 * Date: 08-19-11
 * Time: 09:15 AM
 */
public class B {
    public static void main(String[] args) throws IOException {
        new B().solve();
    }

    private void solve() throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        ArrayList<Laptop> list = new ArrayList<Laptop>();
        int p,r,h,c;
        String [] split;
        for (int i = 0; i < n; i++) {
            split = in.readLine().split(" ");
            p = Integer.parseInt(split[0]);
            r = Integer.parseInt(split[1]);
            h = Integer.parseInt(split[2]);
            c = Integer.parseInt(split[3]);
            list.add(new Laptop(p, r, h, c));
        }
        ArrayList<Laptop> result = new ArrayList<Laptop>();
        for (int i = 0; i < n; i++) {
            boolean add = true;
            for (int j = 0; j < n; j++) {
                if(i == j)
                    continue;
                if (list.get(i).less(list.get(j))) {
                    add = false;
                    break;
                }
            }
            if (add) {
                result.add(list.get(i));
            }
        }
        Collections.sort(result);
        Laptop res = result.get(0);
        for (int i = 0; i < n; i++) {
            Laptop lap = list.get(i);
            if (lap.price == res.price && lap.ram == res.ram && lap.hdd == res.hdd && lap.cost == res.cost) {
                System.out.println(i+1);
                System.exit(0);
            }
        }
    }

    private class Laptop implements Comparable<Laptop> {
        int price, ram, hdd, cost;
        Laptop() {

        }
        Laptop( int p, int r, int h, int c) {
            price = p;
            ram = r;
            hdd = h;
            cost = c;
        }

        public boolean less(Laptop o) {
            return (price < o.price && ram < o.ram && hdd < o.hdd);
        }

        public int compareTo(Laptop o) {
            return cost - o.cost;
        }
    }
}
